<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/1/17 0017
 * Time: 下午 2:40
 */

namespace App\Api\Service\Routes;

use Dingo\Api\Routing\Router;

class CustomerRoute
{
    public function map(Router $router)
    {
        $router->group(['namespace' => 'Customer\Controllers', 'prefix'=>'customer'], function ($router) {

            $router->any('list', 'IndexController@getList');
            $router->any('letter-list', 'IndexController@getAllListWithLetter');
            $router->any('info', 'IndexController@getInfo');
            $router->any('add', 'IndexController@customerAdd');
            $router->any('edit', 'IndexController@customerEdit');
            $router->any('del', 'IndexController@customerDel');
            $router->any('confirm', 'IndexController@customerConfirm');
            $router->any('level-list', 'IndexController@customerLevels');//客户等级（分类）
            $router->any('add-before', 'IndexController@addBefore');

            //客户票据
            $router->any('invoice-list', 'InvoiceController@getList');
            $router->any('invoice-all', 'InvoiceController@getAll');
            $router->any('invoice-add', 'InvoiceController@add');
            $router->any('invoice-edit', 'InvoiceController@edit');
            $router->any('invoice-del', 'InvoiceController@del');

            //客户地址
            $router->any('address-list', 'AddressController@getList');
            $router->any('address-all', 'AddressController@getAll');
            $router->any('address-add', 'AddressController@add');
            $router->any('address-edit', 'AddressController@edit');
            $router->any('address-del', 'AddressController@del');


            $router->any('addressList', 'AddressController@lists');
            $router->any('addressEdit', 'AddressController@edit');
            //库存管理
            $router->any('product-list', 'ProductController@lists');

            //客户结算方式，选择列表
            $setFunction = 'getCustomerSettlementMethodList';
            $router->any('/'.$setFunction,'IndexController@'.$setFunction);


        });
    }
}